package com.stoken.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cascade;

@Entity
public class TravelLeaveMessage implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY) 
	private long id;
	
	@ManyToOne
	@JoinColumn(name="base_username",nullable=false)
	private MemberBaseInfo baseUsername;
	
	@Column(nullable=false,columnDefinition="INT default 0")
	private int isReply;
	
    @OneToOne  
    @Cascade(value={org.hibernate.annotations.CascadeType.DELETE})  
    @JoinColumn(name="leave_reply")  
	private TravelLeaveReply leaveReply;
	
	@ManyToOne
	@JoinColumn(name="leave_type")
	private TravelLeaveType leaveType;
	
	@Temporal(TemporalType.TIMESTAMP)
	private Date leaveTime;
	
	private String leaveTitle;
	
	private String leaveContent;
	
	private String leaveSpare;

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public MemberBaseInfo getBaseUsername() {
		return baseUsername;
	}

	public void setBaseUsername(MemberBaseInfo baseUsername) {
		this.baseUsername = baseUsername;
	}

	public int getIsReply() {
		return isReply;
	}

	public void setIsReply(int isReply) {
		this.isReply = isReply;
	}

	public TravelLeaveType getLeaveType() {
		return leaveType;
	}

	public void setLeaveType(TravelLeaveType leaveType) {
		this.leaveType = leaveType;
	}

	public Date getLeaveTime() {
		return leaveTime;
	}

	public void setLeaveTime(Date leaveTime) {
		this.leaveTime = leaveTime;
	}

	public String getLeaveTitle() {
		return leaveTitle;
	}

	public void setLeaveTitle(String leaveTitle) {
		this.leaveTitle = leaveTitle;
	}

	public String getLeaveContent() {
		return leaveContent;
	}

	public void setLeaveContent(String leaveContent) {
		this.leaveContent = leaveContent;
	}

	public String getLeaveSpare() {
		return leaveSpare;
	}

	public void setLeaveSpare(String leaveSpare) {
		this.leaveSpare = leaveSpare;
	}

	public TravelLeaveReply getLeaveReply() {
		return leaveReply;
	}

	public void setLeaveReply(TravelLeaveReply leaveReply) {
		this.leaveReply = leaveReply;
	}
	
	

	
}
